package com.yunxiang.service.impl;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yunxiang.dao.RedpackDao;
import com.yunxiang.dao.RedpackMapper;
import com.yunxiang.dao.impl.RedpackDaoImpl;
import com.yunxiang.domain.Redpack;
import com.yunxiang.service.RedpackService;
import com.yunxiang.util.MybatisUtil;

@Service("redpackService")
public class RedpackServiceImpl implements RedpackService {

	@Autowired
	private RedpackMapper redpackMapper;
	

	public Redpack getByPrimaryKey(int key) {
		
		return redpackMapper.selectByPrimaryKey(key);
		
//		SqlSession sqlSession = MybatisUtil.getSqlSession();
//		RedpackMapper mapper = sqlSession.getMapper(RedpackMapper.class);
//		return mapper.selectByPrimaryKey(411);
		
	}

}
